﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Configuration;
using System.Web;
using System.Web.Mvc;
using Ext.Net;
using Ext.Net.MVC;
using EFMysql;
using BLL;

namespace ShuaDanMysql.Controllers
{
    public class OrderController : BaseController
    {
        OrderBll orderBll = new OrderBll();

        // GET: Order
        public ActionResult Index()
        {
            return View();
        }

        [DirectMethod]
        public ActionResult LoadOrder(string searchCondition, StoreRequestParameters param)
        {
            pre_orderSearch orderSearchCondition = (pre_orderSearch)JSON.Deserialize(searchCondition, typeof(pre_orderSearch));
            //string aa = param.Value;
            int pageSize = int.Parse(ConfigurationManager.AppSettings["pagesize"].ToString());
            int totalRecord = 0;
            List<pre_order> order = orderBll
                .GetOrderList(orderSearchCondition,pageSize,param.Page,ref totalRecord).ToList();

            return this.Store(new Paging<pre_order>(order, totalRecord));
        }
    }
}